import request from '@/utils/request'

export function getStationDeviceTree(data) {
  return request({
    url: `/api/v1/getStationDeviceTree?permission=getStationDeviceTree&stationId=${data.stationId}`,
    method: 'get',
    data
  })
}

export function getStationDeviceTab(data) {
  return request({
    url: `/api/v1/getStationDeviceTab?permission=getStationDeviceTab&stationId=${data.stationId}`,
    method: 'get',
    data
  })
}

export function getGroupData(data) {
  return request({
    url: `/api/v1/getGroupData?permission=getGroupData&stationId=${data.stationId}&groupId=${data.groupId}`,
    method: 'get',
    data
  })
}

export function getGroupAlarm(data) {
  return request({
    url: `/api/v1/getGroupAlarm?permission=getGroupAlarm&stationId=${data.stationId}&groupId=${data.groupId}&date=${data.date}&confirm=${data.confirm}`,
    method: 'get',
    data
  })
}

export function getGroupPointCategory(data) {
  return request({
    url: `/api/v1/getGroupPointCategory?permission=getGroupPointCategory&stationId=${data.stationId}&groupId=${data.groupId}`,
    method: 'get',
    data
  })
}

export function getHistoryDay(data) {
  return request({
    url: `/api/v1/getHistoryDay?permission=getHistoryDay&stationId=${data.stationId}&groupId=${data.groupId}&date=${data.date}&options=max&pointCategoryId=${data.pointCategoryId}`,
    method: 'post',
    data
  })
}

export function getGroupReport(data) {
  return request({
    url: `/api/v1/getGroupReport?permission=getGroupReport&stationId=${data.stationId}&groupId=${data.groupId}&date=${data.date}&options=${data.options}`,
    method: 'get',
    data
  })
}

export function getStationWiringData(data) {
  return request({
    url: `/api/v1/getStationWiringData?permission=getStationWiringData&stationId=${data.stationId}&ycIds=${data.ycIds}&yxIds=${data.yxIds}`,
    method: 'POST',
    data
  })
}
